package com.sun.dao;


import com.sun.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {

    @Select("select * from user")
    List<User> getUsers();

    //有多个基本类型或String的参数时，所有参数前面要加上@Param()
    @Select("select * from user where id=#{id}")
    User getUserById(@Param("id") int id);

}
